<?php
/**
 * 系統名稱: Lotto 系統
 * 檔案說明: 專案管理-修改
 * $Author$
 * $Id$
 * $Log$
 *
 */
set_time_limit(0);
include("../config.inc.php");
include(__Common_Path."/AllWeb.inc.php");

$intGroup = (int)$_data["Group"];
if(empty($intGroup))$intGroup = 1;

$strCreditRange = trim($_data["CreditRange"]);
if($strCreditRange == '')$strCreditRange = '10000, 50000, 100000, 200000, 300000, 400000, 500000, 1000000';

$arrWeb = array();
foreach($_arrWeb as $key => $arrV){
	$arrWeb[] = $arrV[0];
}
//$arrCon = file("http://secure.luckyball.cc/crontab/getReport.php?GameDate=".$_data["GameDate"]."&AllWeb=".join(",", $arrWeb));

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://205.177.208.208/crontab/getUserForCreditRange.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 300);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, "Group=".$intGroup."&CreditRange=".$strCreditRange."&AllWeb=".join(",", $arrWeb));
//print "GameDate=".$_data["GameDate"]."&GameTime1=".$_data["GameTime1"]."&GameTime2=".$_data["GameTime2"]."&AllWeb=".join(",", $arrWeb);
$ret = curl_exec ($ch);
curl_close ($ch);

foreach($_arrWeb as $key => $arrV){
	$ret = str_replace("{".$arrV[0]."}", $arrV[1], $ret);
}

$arrGroup = array(1 => '會員', 2 => '代理商', 3 => '總代理', 4 => '股東', 5 => '總監');
?>
<form action="<?php print $_SERVER["PHP_SELF"];?>" name="ReportFrm">
群組：
<select name="Group">
<?php
foreach($arrGroup as $intGp => $strGroup){
	print '<option value="'.$intGp.'"'.($intGroup == $intGp?' selected':'').'>'.$strGroup.'</option>';
}
?>
</select>&nbsp;&nbsp;
信用額度間隔：<input type="text" name="CreditRange" value="<?php print $strCreditRange;?>" size="60">
<input type="button" value="更新" onclick="document.ReportFrm.submit()">
</form>
<?php
print $ret;
?>